<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台（PHP版）
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码，建议反馈是我们前进的动力
// | 开源版本可自由商用，可去除界面版权logo
// | gitee下载：https://gitee.com/likeshop_gitee/likeadmin
// | github下载：https://github.com/likeshop-github/likeadmin
// | 访问官网：https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------

namespace app\api\validate;


use app\common\validate\BaseValidate;


/**
 * transaction验证器
 * Class TransactionRecordValidate
 * @package app\api\validate
 */
class TransactionRecordValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'transaction_id' => 'require',
        'user_id' => 'require',
        'card_id' => 'require',
        'transaction_amount' => 'require',
        'transaction_currency' => 'require',
        'billing_amount' => 'require',
        'billing_currency' => 'require',
        'status' => 'require',
        'transaction_type' => 'require',
        'transaction_date' => 'require',
    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'transaction_id' => '交易唯一ID(uuid)',
        'user_id' => '用户ID',
        'card_id' => '卡片唯一标识',
        'transaction_amount' => '交易金额',
        'transaction_currency' => '交易币种',
        'billing_amount' => '结算金额',
        'billing_currency' => '结算币种',
        'status' => '交易状态:APPROVED,CLEARED,EXPIRED,FAILED,PENDING,REVERSED',
        'transaction_type' => '交易类型:AUTHORIZATION,CLEARING,REFUND,REVERSAL,ORIGINAL_CREDIT',
        'transaction_date' => '交易时间',
    ];


    /**
     * @notes 添加场景
     * @return TransactionRecordValidate
     * @author likeadmin
     * @date 2025/04/09 14:11
     */
    public function sceneAdd()
    {
        return $this->only(['transaction_id','user_id','card_id','transaction_amount','transaction_currency','billing_amount','billing_currency','status','transaction_type','transaction_date']);
    }


    /**
     * @notes 编辑场景
     * @return TransactionRecordValidate
     * @author likeadmin
     * @date 2025/04/09 14:11
     */
    public function sceneEdit()
    {
        return $this->only(['id','transaction_id','user_id','card_id','transaction_amount','transaction_currency','billing_amount','billing_currency','status','transaction_type','transaction_date']);
    }


    /**
     * @notes 删除场景
     * @return TransactionRecordValidate
     * @author likeadmin
     * @date 2025/04/09 14:11
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }


    /**
     * @notes 详情场景
     * @return TransactionRecordValidate
     * @author likeadmin
     * @date 2025/04/09 14:11
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }

}